@extends('master')

@section('content')
<div class="management-content">
    <div class="container">
        <div class="record-list">
           @if(Session::get('message'))
          <div class="alert alert-info" role="alert">{{ Session::get('message') }}</div>
           @endif

           @if(Session::get('error'))
          <div class="alert alert-danger" role="alert">{{ Session::get('error') }}</div>
           @endif

           @if(count($pictures) != 0)
            <h2>图片管理</h2>
            <table class="table">
                <thead>
                    <tr>
                        <th>图片</th>
                        <th>图片信息</th>
                        <th>描述</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                     @foreach ($pictures as $picture)
                    <tr>
                        <td>
                            <img data-remote="/picture/info/{{ $picture->id }}" data-toggle="modal" data-target="#photo-modal" src="{{ '/uploads/picture/' . $picture->thumb }}" alt="">
                        </td>
                        <td>
                            <span>标题 : {{ $picture->name }}</span>
                            <span>图片ID : {{ $picture->sku }}</span>
                            <span>上传时间: {{ $picture->created_at }}</span>
                            <span>状态: {{ $picture->status }}</span>
                        </td>
                        <td>
                            <p>描述信息</p>
                            <h4>关键字</h4>
                            <p>
                               {{ $picture->tags }}
                            </p>
                        </td>
                        <td>
                            <a href="javascript:void(0)" class="btn btn-sm btn-primary" data-remote="/picture/edit/{{ $picture->id }}" data-toggle="modal" data-target="#picture-edit-modal"><i class="glyphicon glyphicon-edit"></i> 编辑</a>
                            <a href="/picture/delete/{{ $picture->id }}" class="btn btn-sm btn-danger"><i class="glyphicon glyphicon-trash"></i> 删除</a>
                        </td>
                    </tr>
                     @endforeach


                </tbody>
            </table>
            @else
            <div class="alert alert-danger" role="alert">没有任何记录！ <a href="/picture/upload" class="alert-link">马上上传</a></div>
            @endif


            {{ $pictures->links() }}
        </div>

    </div>
</div>
@stop




